package com.paradogs.demo.logic.service;

import com.paradogs.demo.logic.service.base.BaseService;
import com.paradogs.framework.common.dao.RoleDao;
import com.paradogs.framework.common.data.RoleLevel;
import com.paradogs.framework.common.entity.Role;
import com.paradogs.framework.common.pojo.misc.LongWrapper;
import org.springframework.stereotype.Component;

/**
 * @author: yumi
 * @date: 2023/12/12  9:36
 * @Description: TODO
 */
@Component
public class RoleService extends BaseService<Role, RoleDao> {

    /**
     * 获取指定等级升级所需的经验
     * @param level
     * @return
     */
    public LongWrapper getLevelExp(Long level) {
        RoleLevel.Data data = RoleLevel.getData(level);
        if (data == null) {
            return new LongWrapper(-1L);
        }
        return new LongWrapper(data.getExp());
    }


}
